package wrapper;
//包装类演示
public class IntegerDemo {
    public static void main(String[] args) {
        //valueOf()方法会复用1个字节-128-127范围内的数据
        Integer i1=Integer.valueOf(127);
        Integer i2=Integer.valueOf(127);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));
        System.out.println("---------------------");

        Integer i=Integer .valueOf(5);
        int j=i.intValue();
        System.out.println(j);
         Integer m=5;
         int n=m;
        System.out.println(n);
        int max=Integer.MAX_VALUE;
        int min=Integer.MIN_VALUE;
        System.out.println("int的最大值为："+max+",最小值为"+min);
        long max1=Long.MAX_VALUE;
        long min1=Long.MIN_VALUE;
        System.out.println("long的最大值为："+max+",最小值为"+min);

        String s1="40";
        int age=Integer.parseInt(s1);
        System.out.println(age);
        String s2="12.34";
        double price=Double.parseDouble(s2);
        System.out.println(price);


    }
}
